<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "cust");
%>

<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style>
	.poster{
		width:10rem;
	}
</style>
	<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	    <div class="detailed-navbar-content panel-body">
	        <t:form commandName="custPoster" action="/admin/cust/custPoster/save" method="post" cssClass="form-horizontal">
	            <div class="hide">
		         	<t:input type="hidden" path="posterImg" />
            	</div>
	            <t:formgroup>
					<t:label path="posterType" cssClass="col-sm-2" />
					<t:selectButton path="posterType" colClass="col-sm-4" />
					<t:label path="descript" cssClass="col-sm-1"/>
					<t:input path="descript" colClass="col-sm-3"/>
				</t:formgroup>
	        	<div class="col-sm-6">
	        		<t:label path="posterImg" cssClass="col-sm-4" style="margin-top:3rem;"/>
	        		<div class="col-sm-4">
	        			<img class=" default poster" id="mainPicShow" src="<c:url value='/images/we/invitationIndex/addMore.png' />"/>
	        		</div>
	        		<div class="col-sm-4">
	        			<label style="margin-top:2rem;">加载进度</label>
	        			<div style="width:100px;height: 10px;margin-top:0.5rem; border: 2px solid #afafaf;border-radius:15px;"class="mainParent">
        			    	<div style="width:0px;height: 7px;background-color: #afafaf" class="mainProgress"></div>
        		     	</div>
        		     	<button type="button" class="btn-info" id="deleteMainPic" style="padding-left:10px; margin-top:1rem; border-radius:6px;">删除图片</button>
	        		</div>
	        	</div>
	        </t:form>
	    </div>
	    
	    <div class="navbar-fixed-bottom">
			<t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
				<t:button icon="icon-floppy-disk" onclick="saveData()" cssClass="btn-info" csize="sm">保存</t:button>
			</t:panelFoot>
		</div>
	</t:panel>
	
<script>
	$(function(){
		$("#mainPicShow").on('click',function(e) {
			$(".mainProgress").width(0);
			$("#posterImg").startCosFileUpload({
				fillImg:"#mainPicShow",
				progressCallback:function(curr, sha1){
					$(".mainParent").show();
					$(".mainProgress").width(0);
					$(".mainProgress").width(sha1*96);
				}
			});
		});
	});
	function saveData(){
		$("form:first").submit();
	}	
</script>	
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/editor/ueditor.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/tools/upload-cos.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>